require 'base64'

class LiteFetion < ActiveResource::Base
  self.site = Rails.env.production? ? "http://localhost:4848" : "http://localhost:9000"

  def self.add_buddy_verify(mobile,user = User.current_user)
    verify = new(
      :id => mobile
    ).get(:add_buddy_verify)
    File.open("D://projects/mytusi/public//images//bind_fetion_verify//#{user.id}.gif", "wb") do |f| 
      f.write(Base64.decode64(verify['data'])) 
    end
    verify
  end  
  
  def self.client_state(mobile)
    new(
      :id => mobile      
    ).get(:client_state)['state']
  end
end  